import request from '@/utils/request'

export default {
  listPage(currentPage, pageSize, queryTrainingDTO) {
    return request({
      url: `/training/listSearch/${currentPage}/${pageSize}`,
      method: 'post',
      data: queryTrainingDTO
    })
  },
  add(training) {
    return request({
      url: `/training/insertOrUpdate`,
      method: 'post',
      data: training
    })
  },
  deleteOneTraining(id) {
    return request({
      url: `/training/delete/${id}`,
      method: 'post'
    })
  },
  deleteSelectTraining(ids) {
    return request({
      url: `/training/deleteBatch`,
      method: 'delete',
      data: ids
    })
  },
  listAll() {
    return request({
      url: `/training/list`,
      method: 'get'
    })
  },
  nameOnly(name) {
    return request({
      url: `/training/nameOnly/${name}`,
      method: 'get'

    })
  },
  selectTrainingById(id) {
    return request({
      url: `training/select/${id}`,
      method: 'get'
    })
  },
  changeSwitchVIP(id, isVip) {
    return request({
      url: `training/setVip/${id}/${isVip}`,
      method: 'get'
    })
  }
}

